const initState = {
    userInfo: {},
    authList: [],
    menuList: [],
    housingList: [],
    orderList: [],
    brokerList: [],
    consultList: [],
    liveList: [],
    groupList: [],
}


const reudcer = (state = initState, action: any) => {
    const { type, payload } = action;
    switch (type) {

        case 'CHANGE_USER_INFO':
            return { ...state, userInfo: action.data }
        case 'CHANGE_AUTH_LIST':
            return { ...state, authList: action.data }
        case 'CHANGE_MENU_LIST':
            return { ...state, menuList: action.data }
        case 'GET_HOUSING_LIST':
            return { ...state, housingList: payload }
        case 'GET_ORDER_LIST':
            return { ...state, orderList: payload }
        case 'GET_BROKER_LIST':
            return { ...state, brokerList: payload }
        case 'GET_CONSULT_LIST':
            return { ...state, consultList: payload }
        case 'GET_LIVE_LIST':
            return { ...state, liveList: payload }
        case 'GET_GROUP_LIST':
            return { ...state, groupList: payload }
        default:
            return state
    }
}

export default reudcer;